package cn.training.service;

import java.util.List;

import jp.terasoluna.fw.dao.QueryDAO;
import jp.terasoluna.fw.dao.UpdateDAO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.training.bean.UserBean;

@Service
public class HelloWorldService {

	@Autowired
	QueryDAO queryDao;

	@Autowired
	UpdateDAO updateDao;

	
	//public UserBean searchUser(UserBean frm) {
		//frm = queryDao.executeForObject("user.selectuser", frm, UserBean.class);
		////frm.setUserId("test");
		
		//return frm;
	//}
	
	public List<UserBean> searchUser(UserBean frm) {
		List<UserBean> result=queryDao.executeForObjectList("user.selectuser", frm);	
		return result;
	}	
	public int insert(UserBean frm) {
	return updateDao.execute("user.insertuser", frm); 
		
	}
    public int updateUser(UserBean frm) {
		return updateDao.execute("user.updateuser", frm); 		
	}
    public int deleteUser(UserBean frm) {
  		return updateDao.execute("user.deleteuser", frm); 
  		
  	}
    
}
